package test1;
import java.util.*;
import java.util.Arrays;
import java.lang.String;
public class Main {
    
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String ru;
		while(in.hasNext())
		{
		   ru=in.next();
		   while(ru!=null)
		   {
		   int []shu=new int[100];
		   int zhuan;
		   if(ru.equals("fib"))
		   {
			   zhuan=1;
		   }
		   else if(ru.equals("sort"))
		   {
			   zhuan=2;
		   }
		   else if(ru.equals("search"))
		   {
			   zhuan=3;
		   }
		   else if(ru.equals("getBirthDate"))
		   {
			   zhuan=4;
		   }
		   else zhuan=0;
		   switch(zhuan)
		   {
		     case 1:
		            int n=in.nextInt();
		            fib(n);break;
		     case 2:
		    	 	for(int i=0;i<100;i++)
		    	 	{
		    	 		shu[i]=in.nextInt();
		    	 	}
		    	 	Arrays.sort(shu);break;
		     case 3:
		    	 	int cha=in.nextInt();
		    	 	int local=Arrays.binarySearch(shu, cha);
		    	 	System.out.println(local);break;
		     case 4:
		    	 	int ci=in.nextInt();
		    	 	int i=1;
		    	 	while(i<=ci)
		    	 	{
		    	 		String shen=in.nextLine();
		    	 		i++;
		    	 		String birth=shen.substring(6, 13);
		    	 		char []c=birth.toCharArray();
		    	 		for(int j=0;j<4;j++)
		    	 		{
		    	 			System.out.println(c[j]);
		    	 		}
		    	 		System.out.println("-");
		    	 		for(int j=4;j<6;j++)
		    	 		{
		    	 			System.out.println(c[j]);
		    	 		}
		    	 		System.out.println("-");
		    	 		for(int j=6;j<8;j++)
		    	 		{
		    	 			System.out.println(c[j]);
		    	 		}
		    	 	}break;
		     default :System.out.println("exit");break;
		   }
		   }
		}
	}
	public static int fib(int n)
	{
    	int a = 0;
		if(n==1) a=1;
		if(n==2) a=1;
		if(n>=3) a=fib(n-1)+fib(n-2);
		System.out.print(a+" ");
		return a;
	}

}
